Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh-112536: Add more TSAN tests #116896

Merged
merged 6 commits into from
Mar 16, 2024
Merged

Conversation

corona10
Copy link
Member

@corona10 corona10 commented Mar 16, 2024

@corona10
Copy link
Member Author

@corona10 corona10 changed the title gh-112536: Add more TSAN tests [Test] gh-112536: Add more TSAN tests Mar 16, 2024
@corona10 corona10 changed the title [Test] gh-112536: Add more TSAN tests gh-112536: Add more TSAN tests Mar 16, 2024
@corona10 corona10 requested a review from pitrou March 16, 2024 11:31
@corona10 corona10 marked this pull request as ready for review March 16, 2024 11:32
@corona10 corona10 requested a review from colesbury March 16, 2024 11:34
@corona10
Copy link
Member Author

corona10 commented Mar 16, 2024

test_pickle
test_compileall
test_fork1

@pitrou
Those tests are currently not passed with PYTHON_GIL =0, but if they are not working with TSAN test, no worth adding it.
swtaarrs@1fe9165#diff-590c02490d066378045dd48d62e86dc85d3fb4ad934b6a2b2b0b1112e59eaefb
Thank you for pointing out :)

@@ -10,12 +10,14 @@
'test_importlib',
'test_io',
'test_logging',
'test_queue',
Copy link
Member Author

@corona10 corona10 Mar 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

def queue_join_test(self, q):

'test_ssl',
'test_syslog',
'test_thread',
'test_threadedtempfile',
'test_threading_local',
'test_threadsignals',
'test_weakref',
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@threading_helper.requires_working_threading()
def test_threaded_weak_valued_setdefault(self):
d = weakref.WeakValueDictionary()
with collect_in_thread():
for i in range(100000):
x = d.setdefault(10, RefCycle())
self.assertIsNot(x, None) # we never put None in there!
del x
@threading_helper.requires_working_threading()
def test_threaded_weak_valued_pop(self):
d = weakref.WeakValueDictionary()
with collect_in_thread():
for i in range(100000):
d[10] = RefCycle()
x = d.pop(10, 10)
self.assertIsNot(x, None) # we never put None in there!
@threading_helper.requires_working_threading()
def test_threaded_weak_valued_consistency(self):
# Issue #28427: old keys should not remove new values from
# WeakValueDictionary when collecting from another thread.
d = weakref.WeakValueDictionary()
with collect_in_thread():
for i in range(200000):
o = RefCycle()
d[10] = o
# o is still alive, so the dict can't be empty
self.assertEqual(len(d), 1)
o = None # lose ref

@corona10 corona10 requested a review from pitrou March 16, 2024 13:01
@pitrou pitrou enabled auto-merge (squash) March 16, 2024 14:37
@pitrou pitrou merged commit bee7e29 into python:main Mar 16, 2024
40 checks passed
pitrou added a commit to pitrou/cpython that referenced this pull request Mar 17, 2024
---------

Co-authored-by: Antoine Pitrou <antoine@python.org>
vstinner pushed a commit to vstinner/cpython that referenced this pull request Mar 20, 2024
---------

Co-authored-by: Antoine Pitrou <antoine@python.org>
adorilson pushed a commit to adorilson/cpython that referenced this pull request Mar 25, 2024
---------

Co-authored-by: Antoine Pitrou <antoine@python.org>
diegorusso pushed a commit to diegorusso/cpython that referenced this pull request Apr 17, 2024
---------

Co-authored-by: Antoine Pitrou <antoine@python.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants